package org.example;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "boot-topic-sync", consumerGroup = "boot-consumerGroup")
public class MessageListener implements RocketMQListener<MessageExt> {


    @Override
    public void onMessage(MessageExt messageExt) {

        System.out.println("message is " + new String(messageExt.getBody()));


        System.out.println("msg_id  is :" + messageExt.getMsgId());
    }
}
